// 拨号工具类
import 'package:capture_audio/core/utils/index.dart';
import 'package:flutter_phone_direct_caller/flutter_phone_direct_caller.dart';

/// 拨号工具类
/// 通过url_launcher插件调用系统拨号功能
class Dialer {
  /// 拨打电话
  /// [phoneNumber] 电话号码
  static Future<void> makePhoneCall(String phoneNumber) async {
    // 请求电话权限
    bool hasPermission = await RequestPermission.requestPhonePermission();

    if (hasPermission) {
      await FlutterPhoneDirectCaller.callNumber(phoneNumber);
    }
  }
}
